﻿using System;
using System.Collections.Generic;

namespace VisionCloud.Core.Model.Sys
{
    /// <summary>
    /// 组织架构
    /// </summary>
    public class SysOrg : BaseEntity
    {
        public Guid Id { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 上级组织架构Id
        /// </summary>
        public Guid? SuperOrgId { get; set; }

        /// <summary>
        /// 是否最后一个节点
        /// </summary>
        public bool IsLast { get; set; } = true;

        /// <summary>
        /// 公司地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 是否内部公司
        /// </summary>
        public bool? IsInterOrg { get; set; }

        /// <summary>
        /// 子项
        /// </summary>
        public virtual ICollection<SysOrg> SubOrgs { get; set; } = new List<SysOrg>();

        /// <summary>
        /// 父项
        /// </summary>
        public virtual SysOrg SuperOrg { get; set; }

        /// <summary>
        /// 人员
        /// </summary>
        public virtual ICollection<SysOrgUser> SysOrgUsers { get; set; } = new List<SysOrgUser>();
    }
}